<%@ page contentType="text/html; charset=UTF-8" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>妙兜开放平台管理中心-登录页面</title>
    <link href="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/css/bootstrap.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/font-awesome-4.3.0/css/font-awesome.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/css/common.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/jquery.form.js"></script>
    <script src="/static/js/jquery.validate.min.js" type="text/javascript"></script>


    <!--[if lt IE 9]>
    <script src="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/js/html5.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/js/respond.min.js"></script>
    <![endif]-->

</head>
<body>
<div class="login-from">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h6 style="font-weight: bold">妙兜3.0管理中心-登录</h6>
        </div>
        <div class="panel-body">
            <form class="form-horizontal m-t" action="/login.action" method="post" id="loginform">
                <div class="form-group">
                    <label class="form-lable col-sm-3">公司账号：</label>
                    <div class="col-sm-8">
                        <input class="form-control" name="userName">
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-lable col-sm-3">密码：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="password" name="passwd">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-8">
                        <input type="submit" class="btn btn-primary" value="登录"/>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $("#loginform").validate({
            rules: {
            	agtloguser: "required",
            	agtlogpwd: "required"
            },
            messages: {
            	agtloguser: "请输入账号",
                agtlogpwd: "请输入密码"
            },
            submitHandler: function (form) {
                $(form).ajaxSubmit({
                    type: "post",  //提交方式
                    url: "/login.action", //请求url
                    success: function (data) { //提交成功的回调函数
                        data = eval("(" + data + ")");
                        if (data.code == 1) {
                            window.location.href = "index.action";
                        } else {
                            alert(data.msg);
                        }
                    }
                });
            }
        });
    });
</script>
</body>
</html>